-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
268 changed files
with
1,774 additions
and
1 deletion.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
specification/resources/kubernetes/examples/python/kubernetes_add_nodePool.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"size": "s-1vcpu-2gb", | ||
"count": 3, | ||
"name": "new-pool", | ||
"tags": [ | ||
"frontend" | ||
], | ||
"auto_scale": True, | ||
"min_nodes": 3, | ||
"max_nodes": 6 | ||
} | ||
resp = client.kubernetes.add_node_pool(cluster_id="ba9d8da", body=req) |
15 changes: 15 additions & 0 deletions
15
specification/resources/kubernetes/examples/python/kubernetes_add_registry.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"cluster_uuids": [ | ||
"bd5f5959-5e1e-4205-a714-a914373942af", | ||
"50c2f44c-011d-493e-aee5-361a4a0d1844" | ||
] | ||
} | ||
resp = client.kubernetes.add_registry(body=req) |
21 changes: 21 additions & 0 deletions
21
specification/resources/kubernetes/examples/python/kubernetes_create_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"name": "prod-cluster-01", | ||
"region": "nyc1", | ||
"version": "1.18.6-do.0", | ||
"node_pools": [ | ||
{ | ||
"size": "s-1vcpu-2gb", | ||
"count": 3, | ||
"name": "worker-pool" | ||
} | ||
] | ||
} | ||
resp = client.kubernetes.create_cluster(body=req) |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_delete_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.delete_cluster(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_delete_node.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.delete_node(cluster_id="da8fda8", node_pool_id="a8f3da", node_id="fa09daf") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_delete_nodePool.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.delete_node_pool(cluster_id="da8fda8", node_pool_id="a8f3da") |
8 changes: 8 additions & 0 deletions
8
.../resources/kubernetes/examples/python/kubernetes_destroy_associatedResourcesDangerous.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.destroy_associated_resources_dangerous(cluster_id="da8fda8") |
20 changes: 20 additions & 0 deletions
20
.../resources/kubernetes/examples/python/kubernetes_destroy_associatedResourcesSelective.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"load_balancers": [ | ||
"4de7ac8b-495b-4884-9a69-1050c6793cd6" | ||
], | ||
"volumes": [ | ||
"ba49449a-7435-11ea-b89e-0a58ac14480f" | ||
], | ||
"volume_snapshots": [ | ||
"edb0478d-7436-11ea-86e6-0a58ac144b91" | ||
] | ||
} | ||
resp = client.kubernetes.destroy_associated_resources_selective(cluster_id="da8fda8", body=req) |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_availableUpgrades.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_available_upgrades(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_cluster(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_clusterLintResults.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_cluster_lint_results(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_clusterUser.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_cluster_user(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_credentials.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_credentials(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_kubeconfig.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_kubeconfig(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_get_nodePool.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.get_node_pool(cluster_id="da8fda8", node_pool_id="a8a8fsa") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_list_associatedResources.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.list_associated_resources(cluster_id="da8fda8") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_list_clusters.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.list_clusters() |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_list_nodePools.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.list_node_pools(cluster_id="a8fsa8d") |
8 changes: 8 additions & 0 deletions
8
specification/resources/kubernetes/examples/python/kubernetes_list_options.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
resp = client.kubernetes.list_options() |
15 changes: 15 additions & 0 deletions
15
specification/resources/kubernetes/examples/python/kubernetes_remove_registry.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"cluster_uuids": [ | ||
"bd5f5959-5e1e-4205-a714-a914373942af", | ||
"50c2f44c-011d-493e-aee5-361a4a0d1844" | ||
] | ||
} | ||
resp = client.kubernetes.remove_registry(body=req) |
26 changes: 26 additions & 0 deletions
26
specification/resources/kubernetes/examples/python/kubernetes_run_clusterLint.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"include_groups": [ | ||
"basic", | ||
"doks", | ||
"security" | ||
], | ||
"include_checks": [ | ||
"bare-pods", | ||
"resource-requirements" | ||
], | ||
"exclude_groups": [ | ||
"workload-health" | ||
], | ||
"exclude_checks": [ | ||
"default-namespace" | ||
] | ||
} | ||
resp = client.kubernetes.run_cluster_lint(cluster_id="1fd32a", body=req) |
25 changes: 25 additions & 0 deletions
25
specification/resources/kubernetes/examples/python/kubernetes_update_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"name": "prod-cluster-01", | ||
"tags": [ | ||
"k8s", | ||
"k8s:bd5f5959-5e1e-4205-a714-a914373942af", | ||
"production", | ||
"web-team" | ||
], | ||
"maintenance_policy": { | ||
"start_time": "12:00", | ||
"day": "any" | ||
}, | ||
"auto_upgrade": True, | ||
"surge_upgrade": True, | ||
"ha": True | ||
} | ||
resp = client.kubernetes.update_cluster(cluster_id="1fd32a", body=req) |
31 changes: 31 additions & 0 deletions
31
specification/resources/kubernetes/examples/python/kubernetes_update_nodePool.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"name": "frontend-pool", | ||
"count": 3, | ||
"tags": [ | ||
"k8s", | ||
"k8s:bd5f5959-5e1e-4205-a714-a914373942af", | ||
"k8s-worker", | ||
"production", | ||
"web-team" | ||
], | ||
"labels": None, | ||
"taints": [ | ||
{ | ||
"key": "priority", | ||
"value": "high", | ||
"effect": "NoSchedule" | ||
} | ||
], | ||
"auto_scale": True, | ||
"min_nodes": 3, | ||
"max_nodes": 6 | ||
} | ||
resp = client.kubernetes.update_node_pool(cluster_id="1fd32a", node_pool_id="392fa3a", body=req) |
12 changes: 12 additions & 0 deletions
12
specification/resources/kubernetes/examples/python/kubernetes_upgrade_cluster.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
lang: Python | ||
source: |- | ||
import os | ||
from pydo import Client | ||
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) | ||
req = { | ||
"version": "1.16.13-do.0" | ||
} | ||
resp = client.kubernetes.upgrade_cluster(cluster_id="1fd32a", body=req) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.