pulumi-vsphere 4.10.0a1710160860__py3-none-any.whl → 4.10.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulumi-vsphere might be problematic. Click here for more details.
- pulumi_vsphere/__init__.py +2 -0
- pulumi_vsphere/_inputs.py +96 -230
- pulumi_vsphere/compute_cluster.py +700 -1477
- pulumi_vsphere/compute_cluster_vm_affinity_rule.py +28 -16
- pulumi_vsphere/datacenter.py +26 -12
- pulumi_vsphere/datastore_cluster.py +154 -350
- pulumi_vsphere/distributed_port_group.py +70 -175
- pulumi_vsphere/distributed_virtual_switch.py +308 -805
- pulumi_vsphere/file.py +16 -24
- pulumi_vsphere/get_compute_cluster.py +0 -4
- pulumi_vsphere/get_compute_cluster_host_group.py +8 -10
- pulumi_vsphere/get_content_library.py +0 -4
- pulumi_vsphere/get_custom_attribute.py +0 -4
- pulumi_vsphere/get_datacenter.py +0 -4
- pulumi_vsphere/get_datastore.py +27 -7
- pulumi_vsphere/get_datastore_cluster.py +0 -4
- pulumi_vsphere/get_datastore_stats.py +194 -0
- pulumi_vsphere/get_distributed_virtual_switch.py +2 -4
- pulumi_vsphere/get_dynamic.py +4 -8
- pulumi_vsphere/get_folder.py +0 -4
- pulumi_vsphere/get_guest_os_customization.py +0 -4
- pulumi_vsphere/get_host.py +0 -4
- pulumi_vsphere/get_host_pci_device.py +4 -12
- pulumi_vsphere/get_host_thumbprint.py +0 -4
- pulumi_vsphere/get_host_vgpu_profile.py +182 -0
- pulumi_vsphere/get_license.py +0 -4
- pulumi_vsphere/get_network.py +0 -4
- pulumi_vsphere/get_policy.py +0 -4
- pulumi_vsphere/get_resource_pool.py +2 -10
- pulumi_vsphere/get_role.py +0 -4
- pulumi_vsphere/get_tag.py +0 -4
- pulumi_vsphere/get_tag_category.py +0 -4
- pulumi_vsphere/get_vapp_container.py +0 -4
- pulumi_vsphere/get_virtual_machine.py +29 -9
- pulumi_vsphere/get_vmfs_disks.py +0 -4
- pulumi_vsphere/guest_os_customization.py +50 -0
- pulumi_vsphere/ha_vm_override.py +189 -378
- pulumi_vsphere/host.py +0 -20
- pulumi_vsphere/host_port_group.py +12 -24
- pulumi_vsphere/host_virtual_switch.py +140 -287
- pulumi_vsphere/license.py +0 -32
- pulumi_vsphere/outputs.py +167 -230
- pulumi_vsphere/resource_pool.py +48 -22
- pulumi_vsphere/virtual_disk.py +10 -10
- pulumi_vsphere/virtual_machine.py +639 -807
- pulumi_vsphere/virtual_machine_snapshot.py +6 -10
- pulumi_vsphere/vm_storage_policy.py +72 -84
- pulumi_vsphere/vnic.py +8 -20
- {pulumi_vsphere-4.10.0a1710160860.dist-info → pulumi_vsphere-4.10.1.dist-info}/METADATA +1 -1
- pulumi_vsphere-4.10.1.dist-info/RECORD +82 -0
- {pulumi_vsphere-4.10.0a1710160860.dist-info → pulumi_vsphere-4.10.1.dist-info}/WHEEL +1 -1
- pulumi_vsphere-4.10.0a1710160860.dist-info/RECORD +0 -80
- {pulumi_vsphere-4.10.0a1710160860.dist-info → pulumi_vsphere-4.10.1.dist-info}/top_level.txt +0 -0
pulumi_vsphere/file.py
CHANGED
|
@@ -298,37 +298,33 @@ class File(pulumi.CustomResource):
|
|
|
298
298
|
|
|
299
299
|
### Uploading a File
|
|
300
300
|
|
|
301
|
-
<!--Start PulumiCodeChooser -->
|
|
302
301
|
```python
|
|
303
302
|
import pulumi
|
|
304
303
|
import pulumi_vsphere as vsphere
|
|
305
304
|
|
|
306
|
-
ubuntu_vmdk_upload = vsphere.File("
|
|
307
|
-
create_directories=True,
|
|
305
|
+
ubuntu_vmdk_upload = vsphere.File("ubuntu_vmdk_upload",
|
|
308
306
|
datacenter="dc-01",
|
|
309
307
|
datastore="datastore-01",
|
|
308
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
310
309
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
311
|
-
|
|
310
|
+
create_directories=True)
|
|
312
311
|
```
|
|
313
|
-
<!--End PulumiCodeChooser -->
|
|
314
312
|
|
|
315
313
|
### Copying a File
|
|
316
314
|
|
|
317
|
-
<!--Start PulumiCodeChooser -->
|
|
318
315
|
```python
|
|
319
316
|
import pulumi
|
|
320
317
|
import pulumi_vsphere as vsphere
|
|
321
318
|
|
|
322
|
-
ubuntu_copy = vsphere.File("
|
|
323
|
-
|
|
319
|
+
ubuntu_copy = vsphere.File("ubuntu_copy",
|
|
320
|
+
source_datacenter="dc-01",
|
|
324
321
|
datacenter="dc-01",
|
|
322
|
+
source_datastore="datastore-01",
|
|
325
323
|
datastore="datastore-01",
|
|
324
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
326
325
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
327
|
-
|
|
328
|
-
source_datastore="datastore-01",
|
|
329
|
-
source_file="/my/src/path/custom_ubuntu.vmdk")
|
|
326
|
+
create_directories=True)
|
|
330
327
|
```
|
|
331
|
-
<!--End PulumiCodeChooser -->
|
|
332
328
|
|
|
333
329
|
:param str resource_name: The name of the resource.
|
|
334
330
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
@@ -360,37 +356,33 @@ class File(pulumi.CustomResource):
|
|
|
360
356
|
|
|
361
357
|
### Uploading a File
|
|
362
358
|
|
|
363
|
-
<!--Start PulumiCodeChooser -->
|
|
364
359
|
```python
|
|
365
360
|
import pulumi
|
|
366
361
|
import pulumi_vsphere as vsphere
|
|
367
362
|
|
|
368
|
-
ubuntu_vmdk_upload = vsphere.File("
|
|
369
|
-
create_directories=True,
|
|
363
|
+
ubuntu_vmdk_upload = vsphere.File("ubuntu_vmdk_upload",
|
|
370
364
|
datacenter="dc-01",
|
|
371
365
|
datastore="datastore-01",
|
|
366
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
372
367
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
373
|
-
|
|
368
|
+
create_directories=True)
|
|
374
369
|
```
|
|
375
|
-
<!--End PulumiCodeChooser -->
|
|
376
370
|
|
|
377
371
|
### Copying a File
|
|
378
372
|
|
|
379
|
-
<!--Start PulumiCodeChooser -->
|
|
380
373
|
```python
|
|
381
374
|
import pulumi
|
|
382
375
|
import pulumi_vsphere as vsphere
|
|
383
376
|
|
|
384
|
-
ubuntu_copy = vsphere.File("
|
|
385
|
-
|
|
377
|
+
ubuntu_copy = vsphere.File("ubuntu_copy",
|
|
378
|
+
source_datacenter="dc-01",
|
|
386
379
|
datacenter="dc-01",
|
|
380
|
+
source_datastore="datastore-01",
|
|
387
381
|
datastore="datastore-01",
|
|
382
|
+
source_file="/my/src/path/custom_ubuntu.vmdk",
|
|
388
383
|
destination_file="/my/dst/path/custom_ubuntu.vmdk",
|
|
389
|
-
|
|
390
|
-
source_datastore="datastore-01",
|
|
391
|
-
source_file="/my/src/path/custom_ubuntu.vmdk")
|
|
384
|
+
create_directories=True)
|
|
392
385
|
```
|
|
393
|
-
<!--End PulumiCodeChooser -->
|
|
394
386
|
|
|
395
387
|
:param str resource_name: The name of the resource.
|
|
396
388
|
:param FileArgs args: The arguments to use to populate this resource's properties.
|
|
@@ -91,7 +91,6 @@ def get_compute_cluster(datacenter_id: Optional[str] = None,
|
|
|
91
91
|
|
|
92
92
|
## Example Usage
|
|
93
93
|
|
|
94
|
-
<!--Start PulumiCodeChooser -->
|
|
95
94
|
```python
|
|
96
95
|
import pulumi
|
|
97
96
|
import pulumi_vsphere as vsphere
|
|
@@ -100,7 +99,6 @@ def get_compute_cluster(datacenter_id: Optional[str] = None,
|
|
|
100
99
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
101
100
|
datacenter_id=datacenter.id)
|
|
102
101
|
```
|
|
103
|
-
<!--End PulumiCodeChooser -->
|
|
104
102
|
|
|
105
103
|
|
|
106
104
|
:param str datacenter_id: The managed object reference ID
|
|
@@ -139,7 +137,6 @@ def get_compute_cluster_output(datacenter_id: Optional[pulumi.Input[Optional[str
|
|
|
139
137
|
|
|
140
138
|
## Example Usage
|
|
141
139
|
|
|
142
|
-
<!--Start PulumiCodeChooser -->
|
|
143
140
|
```python
|
|
144
141
|
import pulumi
|
|
145
142
|
import pulumi_vsphere as vsphere
|
|
@@ -148,7 +145,6 @@ def get_compute_cluster_output(datacenter_id: Optional[pulumi.Input[Optional[str
|
|
|
148
145
|
compute_cluster = vsphere.get_compute_cluster(name="cluster-01",
|
|
149
146
|
datacenter_id=datacenter.id)
|
|
150
147
|
```
|
|
151
|
-
<!--End PulumiCodeChooser -->
|
|
152
148
|
|
|
153
149
|
|
|
154
150
|
:param str datacenter_id: The managed object reference ID
|
|
@@ -85,22 +85,21 @@ def get_compute_cluster_host_group(compute_cluster_id: Optional[str] = None,
|
|
|
85
85
|
|
|
86
86
|
## Example Usage
|
|
87
87
|
|
|
88
|
-
<!--Start PulumiCodeChooser -->
|
|
89
88
|
```python
|
|
90
89
|
import pulumi
|
|
91
90
|
import pulumi_vsphere as vsphere
|
|
92
91
|
|
|
93
|
-
datacenter = vsphere.get_datacenter(name=
|
|
94
|
-
cluster = vsphere.get_compute_cluster(name=
|
|
92
|
+
datacenter = vsphere.get_datacenter(name=vsphere_datacenter)
|
|
93
|
+
cluster = vsphere.get_compute_cluster(name=vsphere_cluster,
|
|
95
94
|
datacenter_id=datacenter.id)
|
|
96
95
|
host_group1 = vsphere.get_compute_cluster_host_group(name="host_group1",
|
|
97
96
|
compute_cluster_id=cluster.id)
|
|
98
|
-
host_rule1 = vsphere.ComputeClusterVmHostRule("
|
|
97
|
+
host_rule1 = vsphere.ComputeClusterVmHostRule("host_rule1",
|
|
99
98
|
compute_cluster_id=cluster.id,
|
|
99
|
+
name="terraform-host-rule1",
|
|
100
100
|
vm_group_name="vm_group1",
|
|
101
101
|
affinity_host_group_name=host_group1.name)
|
|
102
102
|
```
|
|
103
|
-
<!--End PulumiCodeChooser -->
|
|
104
103
|
|
|
105
104
|
|
|
106
105
|
:param str compute_cluster_id: The [managed object reference ID][docs-about-morefs]
|
|
@@ -133,22 +132,21 @@ def get_compute_cluster_host_group_output(compute_cluster_id: Optional[pulumi.In
|
|
|
133
132
|
|
|
134
133
|
## Example Usage
|
|
135
134
|
|
|
136
|
-
<!--Start PulumiCodeChooser -->
|
|
137
135
|
```python
|
|
138
136
|
import pulumi
|
|
139
137
|
import pulumi_vsphere as vsphere
|
|
140
138
|
|
|
141
|
-
datacenter = vsphere.get_datacenter(name=
|
|
142
|
-
cluster = vsphere.get_compute_cluster(name=
|
|
139
|
+
datacenter = vsphere.get_datacenter(name=vsphere_datacenter)
|
|
140
|
+
cluster = vsphere.get_compute_cluster(name=vsphere_cluster,
|
|
143
141
|
datacenter_id=datacenter.id)
|
|
144
142
|
host_group1 = vsphere.get_compute_cluster_host_group(name="host_group1",
|
|
145
143
|
compute_cluster_id=cluster.id)
|
|
146
|
-
host_rule1 = vsphere.ComputeClusterVmHostRule("
|
|
144
|
+
host_rule1 = vsphere.ComputeClusterVmHostRule("host_rule1",
|
|
147
145
|
compute_cluster_id=cluster.id,
|
|
146
|
+
name="terraform-host-rule1",
|
|
148
147
|
vm_group_name="vm_group1",
|
|
149
148
|
affinity_host_group_name=host_group1.name)
|
|
150
149
|
```
|
|
151
|
-
<!--End PulumiCodeChooser -->
|
|
152
150
|
|
|
153
151
|
|
|
154
152
|
:param str compute_cluster_id: The [managed object reference ID][docs-about-morefs]
|
|
@@ -62,14 +62,12 @@ def get_content_library(name: Optional[str] = None,
|
|
|
62
62
|
|
|
63
63
|
## Example Usage
|
|
64
64
|
|
|
65
|
-
<!--Start PulumiCodeChooser -->
|
|
66
65
|
```python
|
|
67
66
|
import pulumi
|
|
68
67
|
import pulumi_vsphere as vsphere
|
|
69
68
|
|
|
70
69
|
library = vsphere.get_content_library(name="Content Library")
|
|
71
70
|
```
|
|
72
|
-
<!--End PulumiCodeChooser -->
|
|
73
71
|
|
|
74
72
|
|
|
75
73
|
:param str name: The name of the content library.
|
|
@@ -94,14 +92,12 @@ def get_content_library_output(name: Optional[pulumi.Input[str]] = None,
|
|
|
94
92
|
|
|
95
93
|
## Example Usage
|
|
96
94
|
|
|
97
|
-
<!--Start PulumiCodeChooser -->
|
|
98
95
|
```python
|
|
99
96
|
import pulumi
|
|
100
97
|
import pulumi_vsphere as vsphere
|
|
101
98
|
|
|
102
99
|
library = vsphere.get_content_library(name="Content Library")
|
|
103
100
|
```
|
|
104
|
-
<!--End PulumiCodeChooser -->
|
|
105
101
|
|
|
106
102
|
|
|
107
103
|
:param str name: The name of the content library.
|
|
@@ -76,14 +76,12 @@ def get_custom_attribute(name: Optional[str] = None,
|
|
|
76
76
|
|
|
77
77
|
## Example Usage
|
|
78
78
|
|
|
79
|
-
<!--Start PulumiCodeChooser -->
|
|
80
79
|
```python
|
|
81
80
|
import pulumi
|
|
82
81
|
import pulumi_vsphere as vsphere
|
|
83
82
|
|
|
84
83
|
attribute = vsphere.get_custom_attribute(name="test-attribute")
|
|
85
84
|
```
|
|
86
|
-
<!--End PulumiCodeChooser -->
|
|
87
85
|
|
|
88
86
|
|
|
89
87
|
:param str name: The name of the custom attribute.
|
|
@@ -114,14 +112,12 @@ def get_custom_attribute_output(name: Optional[pulumi.Input[str]] = None,
|
|
|
114
112
|
|
|
115
113
|
## Example Usage
|
|
116
114
|
|
|
117
|
-
<!--Start PulumiCodeChooser -->
|
|
118
115
|
```python
|
|
119
116
|
import pulumi
|
|
120
117
|
import pulumi_vsphere as vsphere
|
|
121
118
|
|
|
122
119
|
attribute = vsphere.get_custom_attribute(name="test-attribute")
|
|
123
120
|
```
|
|
124
|
-
<!--End PulumiCodeChooser -->
|
|
125
121
|
|
|
126
122
|
|
|
127
123
|
:param str name: The name of the custom attribute.
|
pulumi_vsphere/get_datacenter.py
CHANGED
|
@@ -63,14 +63,12 @@ def get_datacenter(name: Optional[str] = None,
|
|
|
63
63
|
|
|
64
64
|
## Example Usage
|
|
65
65
|
|
|
66
|
-
<!--Start PulumiCodeChooser -->
|
|
67
66
|
```python
|
|
68
67
|
import pulumi
|
|
69
68
|
import pulumi_vsphere as vsphere
|
|
70
69
|
|
|
71
70
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
72
71
|
```
|
|
73
|
-
<!--End PulumiCodeChooser -->
|
|
74
72
|
|
|
75
73
|
|
|
76
74
|
:param str name: The name of the datacenter. This can be a name or path.
|
|
@@ -102,14 +100,12 @@ def get_datacenter_output(name: Optional[pulumi.Input[Optional[str]]] = None,
|
|
|
102
100
|
|
|
103
101
|
## Example Usage
|
|
104
102
|
|
|
105
|
-
<!--Start PulumiCodeChooser -->
|
|
106
103
|
```python
|
|
107
104
|
import pulumi
|
|
108
105
|
import pulumi_vsphere as vsphere
|
|
109
106
|
|
|
110
107
|
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
111
108
|
```
|
|
112
|
-
<!--End PulumiCodeChooser -->
|
|
113
109
|
|
|
114
110
|
|
|
115
111
|
:param str name: The name of the datacenter. This can be a name or path.
|
pulumi_vsphere/get_datastore.py
CHANGED
|
@@ -21,7 +21,7 @@ class GetDatastoreResult:
|
|
|
21
21
|
"""
|
|
22
22
|
A collection of values returned by getDatastore.
|
|
23
23
|
"""
|
|
24
|
-
def __init__(__self__, datacenter_id=None, id=None, name=None):
|
|
24
|
+
def __init__(__self__, datacenter_id=None, id=None, name=None, stats=None):
|
|
25
25
|
if datacenter_id and not isinstance(datacenter_id, str):
|
|
26
26
|
raise TypeError("Expected argument 'datacenter_id' to be a str")
|
|
27
27
|
pulumi.set(__self__, "datacenter_id", datacenter_id)
|
|
@@ -31,6 +31,9 @@ class GetDatastoreResult:
|
|
|
31
31
|
if name and not isinstance(name, str):
|
|
32
32
|
raise TypeError("Expected argument 'name' to be a str")
|
|
33
33
|
pulumi.set(__self__, "name", name)
|
|
34
|
+
if stats and not isinstance(stats, dict):
|
|
35
|
+
raise TypeError("Expected argument 'stats' to be a dict")
|
|
36
|
+
pulumi.set(__self__, "stats", stats)
|
|
34
37
|
|
|
35
38
|
@property
|
|
36
39
|
@pulumi.getter(name="datacenterId")
|
|
@@ -50,6 +53,16 @@ class GetDatastoreResult:
|
|
|
50
53
|
def name(self) -> str:
|
|
51
54
|
return pulumi.get(self, "name")
|
|
52
55
|
|
|
56
|
+
@property
|
|
57
|
+
@pulumi.getter
|
|
58
|
+
def stats(self) -> Optional[Mapping[str, Any]]:
|
|
59
|
+
"""
|
|
60
|
+
The disk space usage statistics for the specific datastore. The total
|
|
61
|
+
datastore capacity is represented as `capacity` and the free remaining disk is
|
|
62
|
+
represented as `free`.
|
|
63
|
+
"""
|
|
64
|
+
return pulumi.get(self, "stats")
|
|
65
|
+
|
|
53
66
|
|
|
54
67
|
class AwaitableGetDatastoreResult(GetDatastoreResult):
|
|
55
68
|
# pylint: disable=using-constant-test
|
|
@@ -59,11 +72,13 @@ class AwaitableGetDatastoreResult(GetDatastoreResult):
|
|
|
59
72
|
return GetDatastoreResult(
|
|
60
73
|
datacenter_id=self.datacenter_id,
|
|
61
74
|
id=self.id,
|
|
62
|
-
name=self.name
|
|
75
|
+
name=self.name,
|
|
76
|
+
stats=self.stats)
|
|
63
77
|
|
|
64
78
|
|
|
65
79
|
def get_datastore(datacenter_id: Optional[str] = None,
|
|
66
80
|
name: Optional[str] = None,
|
|
81
|
+
stats: Optional[Mapping[str, Any]] = None,
|
|
67
82
|
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatastoreResult:
|
|
68
83
|
"""
|
|
69
84
|
The `get_datastore` data source can be used to discover the ID of a
|
|
@@ -73,7 +88,6 @@ def get_datastore(datacenter_id: Optional[str] = None,
|
|
|
73
88
|
|
|
74
89
|
## Example Usage
|
|
75
90
|
|
|
76
|
-
<!--Start PulumiCodeChooser -->
|
|
77
91
|
```python
|
|
78
92
|
import pulumi
|
|
79
93
|
import pulumi_vsphere as vsphere
|
|
@@ -82,7 +96,6 @@ def get_datastore(datacenter_id: Optional[str] = None,
|
|
|
82
96
|
datastore = vsphere.get_datastore(name="datastore-01",
|
|
83
97
|
datacenter_id=datacenter.id)
|
|
84
98
|
```
|
|
85
|
-
<!--End PulumiCodeChooser -->
|
|
86
99
|
|
|
87
100
|
|
|
88
101
|
:param str datacenter_id: The managed object reference ID
|
|
@@ -90,22 +103,28 @@ def get_datastore(datacenter_id: Optional[str] = None,
|
|
|
90
103
|
search path used in `name` is an absolute path. For default datacenters, use
|
|
91
104
|
the `id` attribute from an empty `Datacenter` data source.
|
|
92
105
|
:param str name: The name of the datastore. This can be a name or path.
|
|
106
|
+
:param Mapping[str, Any] stats: The disk space usage statistics for the specific datastore. The total
|
|
107
|
+
datastore capacity is represented as `capacity` and the free remaining disk is
|
|
108
|
+
represented as `free`.
|
|
93
109
|
"""
|
|
94
110
|
__args__ = dict()
|
|
95
111
|
__args__['datacenterId'] = datacenter_id
|
|
96
112
|
__args__['name'] = name
|
|
113
|
+
__args__['stats'] = stats
|
|
97
114
|
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
98
115
|
__ret__ = pulumi.runtime.invoke('vsphere:index/getDatastore:getDatastore', __args__, opts=opts, typ=GetDatastoreResult).value
|
|
99
116
|
|
|
100
117
|
return AwaitableGetDatastoreResult(
|
|
101
118
|
datacenter_id=pulumi.get(__ret__, 'datacenter_id'),
|
|
102
119
|
id=pulumi.get(__ret__, 'id'),
|
|
103
|
-
name=pulumi.get(__ret__, 'name')
|
|
120
|
+
name=pulumi.get(__ret__, 'name'),
|
|
121
|
+
stats=pulumi.get(__ret__, 'stats'))
|
|
104
122
|
|
|
105
123
|
|
|
106
124
|
@_utilities.lift_output_func(get_datastore)
|
|
107
125
|
def get_datastore_output(datacenter_id: Optional[pulumi.Input[Optional[str]]] = None,
|
|
108
126
|
name: Optional[pulumi.Input[str]] = None,
|
|
127
|
+
stats: Optional[pulumi.Input[Optional[Mapping[str, Any]]]] = None,
|
|
109
128
|
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatastoreResult]:
|
|
110
129
|
"""
|
|
111
130
|
The `get_datastore` data source can be used to discover the ID of a
|
|
@@ -115,7 +134,6 @@ def get_datastore_output(datacenter_id: Optional[pulumi.Input[Optional[str]]] =
|
|
|
115
134
|
|
|
116
135
|
## Example Usage
|
|
117
136
|
|
|
118
|
-
<!--Start PulumiCodeChooser -->
|
|
119
137
|
```python
|
|
120
138
|
import pulumi
|
|
121
139
|
import pulumi_vsphere as vsphere
|
|
@@ -124,7 +142,6 @@ def get_datastore_output(datacenter_id: Optional[pulumi.Input[Optional[str]]] =
|
|
|
124
142
|
datastore = vsphere.get_datastore(name="datastore-01",
|
|
125
143
|
datacenter_id=datacenter.id)
|
|
126
144
|
```
|
|
127
|
-
<!--End PulumiCodeChooser -->
|
|
128
145
|
|
|
129
146
|
|
|
130
147
|
:param str datacenter_id: The managed object reference ID
|
|
@@ -132,5 +149,8 @@ def get_datastore_output(datacenter_id: Optional[pulumi.Input[Optional[str]]] =
|
|
|
132
149
|
search path used in `name` is an absolute path. For default datacenters, use
|
|
133
150
|
the `id` attribute from an empty `Datacenter` data source.
|
|
134
151
|
:param str name: The name of the datastore. This can be a name or path.
|
|
152
|
+
:param Mapping[str, Any] stats: The disk space usage statistics for the specific datastore. The total
|
|
153
|
+
datastore capacity is represented as `capacity` and the free remaining disk is
|
|
154
|
+
represented as `free`.
|
|
135
155
|
"""
|
|
136
156
|
...
|
|
@@ -73,7 +73,6 @@ def get_datastore_cluster(datacenter_id: Optional[str] = None,
|
|
|
73
73
|
|
|
74
74
|
## Example Usage
|
|
75
75
|
|
|
76
|
-
<!--Start PulumiCodeChooser -->
|
|
77
76
|
```python
|
|
78
77
|
import pulumi
|
|
79
78
|
import pulumi_vsphere as vsphere
|
|
@@ -82,7 +81,6 @@ def get_datastore_cluster(datacenter_id: Optional[str] = None,
|
|
|
82
81
|
datastore_cluster = vsphere.get_datastore_cluster(name="datastore-cluster-01",
|
|
83
82
|
datacenter_id=datacenter.id)
|
|
84
83
|
```
|
|
85
|
-
<!--End PulumiCodeChooser -->
|
|
86
84
|
|
|
87
85
|
|
|
88
86
|
:param str datacenter_id: The managed object reference
|
|
@@ -116,7 +114,6 @@ def get_datastore_cluster_output(datacenter_id: Optional[pulumi.Input[Optional[s
|
|
|
116
114
|
|
|
117
115
|
## Example Usage
|
|
118
116
|
|
|
119
|
-
<!--Start PulumiCodeChooser -->
|
|
120
117
|
```python
|
|
121
118
|
import pulumi
|
|
122
119
|
import pulumi_vsphere as vsphere
|
|
@@ -125,7 +122,6 @@ def get_datastore_cluster_output(datacenter_id: Optional[pulumi.Input[Optional[s
|
|
|
125
122
|
datastore_cluster = vsphere.get_datastore_cluster(name="datastore-cluster-01",
|
|
126
123
|
datacenter_id=datacenter.id)
|
|
127
124
|
```
|
|
128
|
-
<!--End PulumiCodeChooser -->
|
|
129
125
|
|
|
130
126
|
|
|
131
127
|
:param str datacenter_id: The managed object reference
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
|
|
3
|
+
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
import warnings
|
|
7
|
+
import pulumi
|
|
8
|
+
import pulumi.runtime
|
|
9
|
+
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
|
10
|
+
from . import _utilities
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
'GetDatastoreStatsResult',
|
|
14
|
+
'AwaitableGetDatastoreStatsResult',
|
|
15
|
+
'get_datastore_stats',
|
|
16
|
+
'get_datastore_stats_output',
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
@pulumi.output_type
|
|
20
|
+
class GetDatastoreStatsResult:
|
|
21
|
+
"""
|
|
22
|
+
A collection of values returned by getDatastoreStats.
|
|
23
|
+
"""
|
|
24
|
+
def __init__(__self__, capacity=None, datacenter_id=None, free_space=None, id=None):
|
|
25
|
+
if capacity and not isinstance(capacity, dict):
|
|
26
|
+
raise TypeError("Expected argument 'capacity' to be a dict")
|
|
27
|
+
pulumi.set(__self__, "capacity", capacity)
|
|
28
|
+
if datacenter_id and not isinstance(datacenter_id, str):
|
|
29
|
+
raise TypeError("Expected argument 'datacenter_id' to be a str")
|
|
30
|
+
pulumi.set(__self__, "datacenter_id", datacenter_id)
|
|
31
|
+
if free_space and not isinstance(free_space, dict):
|
|
32
|
+
raise TypeError("Expected argument 'free_space' to be a dict")
|
|
33
|
+
pulumi.set(__self__, "free_space", free_space)
|
|
34
|
+
if id and not isinstance(id, str):
|
|
35
|
+
raise TypeError("Expected argument 'id' to be a str")
|
|
36
|
+
pulumi.set(__self__, "id", id)
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
@pulumi.getter
|
|
40
|
+
def capacity(self) -> Optional[Mapping[str, Any]]:
|
|
41
|
+
"""
|
|
42
|
+
A mapping of the capacity for all datastore in the datacenter
|
|
43
|
+
, where the name of the datastore is used as key and the capacity as value.
|
|
44
|
+
"""
|
|
45
|
+
return pulumi.get(self, "capacity")
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
@pulumi.getter(name="datacenterId")
|
|
49
|
+
def datacenter_id(self) -> str:
|
|
50
|
+
"""
|
|
51
|
+
The [managed object reference ID][docs-about-morefs]
|
|
52
|
+
of the datacenter the datastores are located in.
|
|
53
|
+
"""
|
|
54
|
+
return pulumi.get(self, "datacenter_id")
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
@pulumi.getter(name="freeSpace")
|
|
58
|
+
def free_space(self) -> Optional[Mapping[str, Any]]:
|
|
59
|
+
"""
|
|
60
|
+
A mapping of the free space for each datastore in the
|
|
61
|
+
datacenter, where the name of the datastore is used as key and the free
|
|
62
|
+
space as value.
|
|
63
|
+
"""
|
|
64
|
+
return pulumi.get(self, "free_space")
|
|
65
|
+
|
|
66
|
+
@property
|
|
67
|
+
@pulumi.getter
|
|
68
|
+
def id(self) -> str:
|
|
69
|
+
"""
|
|
70
|
+
The provider-assigned unique ID for this managed resource.
|
|
71
|
+
"""
|
|
72
|
+
return pulumi.get(self, "id")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class AwaitableGetDatastoreStatsResult(GetDatastoreStatsResult):
|
|
76
|
+
# pylint: disable=using-constant-test
|
|
77
|
+
def __await__(self):
|
|
78
|
+
if False:
|
|
79
|
+
yield self
|
|
80
|
+
return GetDatastoreStatsResult(
|
|
81
|
+
capacity=self.capacity,
|
|
82
|
+
datacenter_id=self.datacenter_id,
|
|
83
|
+
free_space=self.free_space,
|
|
84
|
+
id=self.id)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def get_datastore_stats(capacity: Optional[Mapping[str, Any]] = None,
|
|
88
|
+
datacenter_id: Optional[str] = None,
|
|
89
|
+
free_space: Optional[Mapping[str, Any]] = None,
|
|
90
|
+
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatastoreStatsResult:
|
|
91
|
+
"""
|
|
92
|
+
The `get_datastore_stats` data source can be used to retrieve the usage stats
|
|
93
|
+
of all vSphere datastore objects in a datacenter. This can then be used as a
|
|
94
|
+
standalone datasource to get information required as input to other data sources.
|
|
95
|
+
|
|
96
|
+
## Example Usage
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import pulumi
|
|
100
|
+
import pulumi_vsphere as vsphere
|
|
101
|
+
|
|
102
|
+
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
103
|
+
datastore_stats = vsphere.get_datastore_stats(datacenter_id=datacenter.id)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
A usefull example of this datasource would be to determine the
|
|
107
|
+
datastore with the most free space. For example, in addition to
|
|
108
|
+
the above:
|
|
109
|
+
|
|
110
|
+
Create an `outputs.tf` like that:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import pulumi
|
|
114
|
+
|
|
115
|
+
pulumi.export("maxFreeSpaceName", their_max_free_space_name)
|
|
116
|
+
pulumi.export("maxFreeSpace", their_max_free_space)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
and a `locals.tf` like that:
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
:param Mapping[str, Any] capacity: A mapping of the capacity for all datastore in the datacenter
|
|
123
|
+
, where the name of the datastore is used as key and the capacity as value.
|
|
124
|
+
:param str datacenter_id: The [managed object reference ID][docs-about-morefs]
|
|
125
|
+
of the datacenter the datastores are located in. For default datacenters, use
|
|
126
|
+
the `id` attribute from an empty `Datacenter` data source.
|
|
127
|
+
|
|
128
|
+
[docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider
|
|
129
|
+
:param Mapping[str, Any] free_space: A mapping of the free space for each datastore in the
|
|
130
|
+
datacenter, where the name of the datastore is used as key and the free
|
|
131
|
+
space as value.
|
|
132
|
+
"""
|
|
133
|
+
__args__ = dict()
|
|
134
|
+
__args__['capacity'] = capacity
|
|
135
|
+
__args__['datacenterId'] = datacenter_id
|
|
136
|
+
__args__['freeSpace'] = free_space
|
|
137
|
+
opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
|
|
138
|
+
__ret__ = pulumi.runtime.invoke('vsphere:index/getDatastoreStats:getDatastoreStats', __args__, opts=opts, typ=GetDatastoreStatsResult).value
|
|
139
|
+
|
|
140
|
+
return AwaitableGetDatastoreStatsResult(
|
|
141
|
+
capacity=pulumi.get(__ret__, 'capacity'),
|
|
142
|
+
datacenter_id=pulumi.get(__ret__, 'datacenter_id'),
|
|
143
|
+
free_space=pulumi.get(__ret__, 'free_space'),
|
|
144
|
+
id=pulumi.get(__ret__, 'id'))
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@_utilities.lift_output_func(get_datastore_stats)
|
|
148
|
+
def get_datastore_stats_output(capacity: Optional[pulumi.Input[Optional[Mapping[str, Any]]]] = None,
|
|
149
|
+
datacenter_id: Optional[pulumi.Input[str]] = None,
|
|
150
|
+
free_space: Optional[pulumi.Input[Optional[Mapping[str, Any]]]] = None,
|
|
151
|
+
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatastoreStatsResult]:
|
|
152
|
+
"""
|
|
153
|
+
The `get_datastore_stats` data source can be used to retrieve the usage stats
|
|
154
|
+
of all vSphere datastore objects in a datacenter. This can then be used as a
|
|
155
|
+
standalone datasource to get information required as input to other data sources.
|
|
156
|
+
|
|
157
|
+
## Example Usage
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
import pulumi
|
|
161
|
+
import pulumi_vsphere as vsphere
|
|
162
|
+
|
|
163
|
+
datacenter = vsphere.get_datacenter(name="dc-01")
|
|
164
|
+
datastore_stats = vsphere.get_datastore_stats(datacenter_id=datacenter.id)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
A usefull example of this datasource would be to determine the
|
|
168
|
+
datastore with the most free space. For example, in addition to
|
|
169
|
+
the above:
|
|
170
|
+
|
|
171
|
+
Create an `outputs.tf` like that:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
import pulumi
|
|
175
|
+
|
|
176
|
+
pulumi.export("maxFreeSpaceName", their_max_free_space_name)
|
|
177
|
+
pulumi.export("maxFreeSpace", their_max_free_space)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
and a `locals.tf` like that:
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
:param Mapping[str, Any] capacity: A mapping of the capacity for all datastore in the datacenter
|
|
184
|
+
, where the name of the datastore is used as key and the capacity as value.
|
|
185
|
+
:param str datacenter_id: The [managed object reference ID][docs-about-morefs]
|
|
186
|
+
of the datacenter the datastores are located in. For default datacenters, use
|
|
187
|
+
the `id` attribute from an empty `Datacenter` data source.
|
|
188
|
+
|
|
189
|
+
[docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider
|
|
190
|
+
:param Mapping[str, Any] free_space: A mapping of the free space for each datastore in the
|
|
191
|
+
datacenter, where the name of the datastore is used as key and the free
|
|
192
|
+
space as value.
|
|
193
|
+
"""
|
|
194
|
+
...
|
|
@@ -97,7 +97,6 @@ def get_distributed_virtual_switch(datacenter_id: Optional[str] = None,
|
|
|
97
97
|
`DistributedPortGroup` resource that uses the first uplink as a
|
|
98
98
|
primary uplink and the second uplink as a secondary.
|
|
99
99
|
|
|
100
|
-
<!--Start PulumiCodeChooser -->
|
|
101
100
|
```python
|
|
102
101
|
import pulumi
|
|
103
102
|
import pulumi_vsphere as vsphere
|
|
@@ -106,11 +105,11 @@ def get_distributed_virtual_switch(datacenter_id: Optional[str] = None,
|
|
|
106
105
|
vds = vsphere.get_distributed_virtual_switch(name="vds-01",
|
|
107
106
|
datacenter_id=datacenter.id)
|
|
108
107
|
dvpg = vsphere.DistributedPortGroup("dvpg",
|
|
108
|
+
name="dvpg-01",
|
|
109
109
|
distributed_virtual_switch_uuid=vds.id,
|
|
110
110
|
active_uplinks=[vds.uplinks[0]],
|
|
111
111
|
standby_uplinks=[vds.uplinks[1]])
|
|
112
112
|
```
|
|
113
|
-
<!--End PulumiCodeChooser -->
|
|
114
113
|
|
|
115
114
|
|
|
116
115
|
:param str datacenter_id: The managed object reference ID
|
|
@@ -153,7 +152,6 @@ def get_distributed_virtual_switch_output(datacenter_id: Optional[pulumi.Input[O
|
|
|
153
152
|
`DistributedPortGroup` resource that uses the first uplink as a
|
|
154
153
|
primary uplink and the second uplink as a secondary.
|
|
155
154
|
|
|
156
|
-
<!--Start PulumiCodeChooser -->
|
|
157
155
|
```python
|
|
158
156
|
import pulumi
|
|
159
157
|
import pulumi_vsphere as vsphere
|
|
@@ -162,11 +160,11 @@ def get_distributed_virtual_switch_output(datacenter_id: Optional[pulumi.Input[O
|
|
|
162
160
|
vds = vsphere.get_distributed_virtual_switch(name="vds-01",
|
|
163
161
|
datacenter_id=datacenter.id)
|
|
164
162
|
dvpg = vsphere.DistributedPortGroup("dvpg",
|
|
163
|
+
name="dvpg-01",
|
|
165
164
|
distributed_virtual_switch_uuid=vds.id,
|
|
166
165
|
active_uplinks=[vds.uplinks[0]],
|
|
167
166
|
standby_uplinks=[vds.uplinks[1]])
|
|
168
167
|
```
|
|
169
|
-
<!--End PulumiCodeChooser -->
|
|
170
168
|
|
|
171
169
|
|
|
172
170
|
:param str datacenter_id: The managed object reference ID
|