Content-Length: 375249 | pFad | https://github.com/googleapis/python-compute/commit/e40275063f8603faf10036ed7b1ef3435a1ab6ce

82 docs(samples): Adding the missing compute_create_windows_instance_ext… · googleapis/python-compute@e402750 · GitHub
Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit e402750

Browse files
authored
docs(samples): Adding the missing compute_create_windows_instance_external_ip region (#300)
1 parent cb3e63e commit e402750

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

samples/ingredients/instances/create_start_instance/create_windows_instance.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ def create_windows_instance(project_id: str, zone: str, instance_name: str,
6767
# that contain Windows instances with only internal IP addresses.
6868
# More information about Private Google Access: https://cloud.google.com/vpc/docs/configure-private-google-access#enabling
6969

70-
instance = create_instance(project_id, zone, instance_name, disks,
71-
machine_type=machine_type, network_link=network_link,
72-
subnetwork_link=subnetwork_link, external_access=True,
73-
)
70+
instance = create_instance(
71+
project_id,
72+
zone,
73+
instance_name,
74+
disks,
75+
machine_type=machine_type,
76+
network_link=network_link,
77+
subnetwork_link=subnetwork_link,
78+
external_access=True, # Set this to False to disable external IP for your instance
79+
)
7480
return instance
7581
# </INGREDIENT>

samples/recipes/instances/create_start_instance/create_windows_instance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
# flake8: noqa
1515

16+
# <REGION compute_create_windows_instance_external_ip>
1617
# <REGION compute_create_windows_instance_internal_ip>
1718
# <IMPORTS/>
1819

@@ -29,3 +30,4 @@
2930

3031
# <INGREDIENT create_windows_instance />
3132
# </REGION compute_create_windows_instance_internal_ip>
33+
# </REGION compute_create_windows_instance_external_ip>

samples/snippets/instances/create_start_instance/create_windows_instance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# directory and apply your changes there.
2020

2121

22+
# [START compute_create_windows_instance_external_ip]
2223
# [START compute_create_windows_instance_internal_ip]
2324
import re
2425
import sys
@@ -305,9 +306,10 @@ def create_windows_instance(
305306
machine_type=machine_type,
306307
network_link=network_link,
307308
subnetwork_link=subnetwork_link,
308-
external_access=True,
309+
external_access=True, # Set this to False to disable external IP for your instance
309310
)
310311
return instance
311312

312313

313314
# [END compute_create_windows_instance_internal_ip]
315+
# [END compute_create_windows_instance_external_ip]

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-compute/commit/e40275063f8603faf10036ed7b1ef3435a1ab6ce

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy