Skip to content

Commit

Permalink
DOCS-179 Add GCP as a cloud provider option
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoninskii committed Dec 21, 2023
1 parent 03011bc commit 9b8dd25
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/clickhouse/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from doublecloud.clickhouse.v1.cluster_service_pb2_grpc import ClusterServiceStub


def create_cluster(sdk, project_id, region_id, name, network_id):
def create_cluster(sdk, project_id, cloud_type, region_id, name, network_id):
cluster_service = sdk.client(ClusterServiceStub)
operation = cluster_service.Create(
CreateClusterRequest(
project_id=project_id,
cloud_type="aws",
cloud_type=cloud_type,
region_id=region_id,
name=name,
resources=ClusterResources(
Expand Down
7 changes: 4 additions & 3 deletions examples/clickhouse/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():

cluster_id = None
try:
operation = create_cluster(sdk, arguments.project_id, arguments.region, arguments.name, arguments.network_id)
operation = create_cluster(sdk, arguments.project_id, arguments.cloud_type, arguments.region, arguments.name, arguments.network_id)
operation_result = sdk.wait_operation_and_get_result(
operation,
)
Expand All @@ -48,10 +48,11 @@ def parse_args():
auth.add_argument(
"--sa-json-path",
help="Path to the service account key JSON file.\nThis file can be created using UI:\n"
"Members -> Service Accounts -> Create and then create API keys",
"Members -> Service Accounts -> Create and then Create API keys",
)
auth.add_argument("--token", help="IAM token")
parser.add_argument("--project-id", help="Your project id", required=True)
parser.add_argument("--project-id", help="Your project ID", required=True)
parser.add_argument("--cloud-type", default="aws," help="Cloud provider")
parser.add_argument("--region", default="eu-central-1", help="Region to deploy to.")
parser.add_argument("--name", default="sdk-example", help="New cluster name.")
parser.add_argument("--network-id", help="Network of the cluster.")
Expand Down
4 changes: 2 additions & 2 deletions examples/kafka/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from doublecloud.kafka.v1.cluster_service_pb2_grpc import ClusterServiceStub


def create_cluster(sdk, project_id, region_id, name, network_id):
def create_cluster(sdk, project_id, cloud_type, region_id, name, network_id):
cluster_service = sdk.client(ClusterServiceStub)
operation = cluster_service.Create(
CreateClusterRequest(
project_id=project_id,
cloud_type="aws",
cloud_type=cloud_type,
region_id=region_id,
name=name,
resources=ClusterResources(
Expand Down
3 changes: 2 additions & 1 deletion examples/kafka/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():

cluster_id = None
try:
operation = create_cluster(sdk, arguments.project_id, arguments.region, arguments.name, arguments.network_id)
operation = create_cluster(sdk, arguments.project_id, arguments.cloud_type, arguments.region, arguments.name, arguments.network_id)
operation_result = sdk.wait_operation_and_get_result(
operation,
)
Expand Down Expand Up @@ -50,6 +50,7 @@ def parse_args():
)
auth.add_argument("--token", help="IAM token")
parser.add_argument("--project-id", help="Your project id", required=True)
parser.add_argument("--cloud-type", default="aws", help="Cloud provider")
parser.add_argument("--region", default="eu-central-1", help="Region to deploy to.")
parser.add_argument("--name", default="sdk-example", help="New cluster name.")
parser.add_argument("--network-id", help="Network of the cluster.")
Expand Down
4 changes: 2 additions & 2 deletions examples/vpc/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from doublecloud.network.v1.network_service_pb2_grpc import NetworkServiceStub


def create_network(sdk, project_id: str, region_id: str, name: str, ipv4_cidr_block: str):
def create_network(sdk, project_id: str, cloud_type: str, region_id: str, name: str, ipv4_cidr_block: str):
network_service = sdk.client(NetworkServiceStub)
operation = network_service.Create(
CreateNetworkRequest(
project_id=project_id,
cloud_type="aws",
cloud_type=cloud_type,
region_id=region_id,
name=name,
ipv4_cidr_block=ipv4_cidr_block,
Expand Down

0 comments on commit 9b8dd25

Please sign in to comment.