Skip to content

Commit

Permalink
Add import feature to all vra resources (#116)
Browse files Browse the repository at this point in the history
Fixes #114.

Signed-off-by: Deepak Mettem <[email protected]>
  • Loading branch information
dmettem authored and markpeek committed Dec 6, 2019
1 parent 4071396 commit a5769a0
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vra/resource_block_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func resourceBlockDevice() *schema.Resource {
Read: resourceBlockDeviceRead,
Update: resourceBlockDeviceUpdate,
Delete: resourceBlockDeviceDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"capacity_in_gb": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountAWS() *schema.Resource {
Read: resourceCloudAccountAWSRead,
Update: resourceCloudAccountAWSUpdate,
Delete: resourceCloudAccountAWSDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"access_key": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountAzure() *schema.Resource {
Read: resourceCloudAccountAzureRead,
Update: resourceCloudAccountAzureUpdate,
Delete: resourceCloudAccountAzureDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{

Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountGCP() *schema.Resource {
Read: resourceCloudAccountGCPRead,
Update: resourceCloudAccountGCPUpdate,
Delete: resourceCloudAccountGCPDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{

Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_nsxt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountNSXT() *schema.Resource {
Read: resourceCloudAccountNSXTRead,
Update: resourceCloudAccountNSXTUpdate,
Delete: resourceCloudAccountNSXTDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"accept_self_signed_cert": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_nsxv.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountNSXV() *schema.Resource {
Read: resourceCloudAccountNSXVRead,
Update: resourceCloudAccountNSXVUpdate,
Delete: resourceCloudAccountNSXVDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"accept_self_signed_cert": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_vmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceCloudAccountVMC() *schema.Resource {
Read: resourceCloudAccountVMCRead,
Update: resourceCloudAccountVMCUpdate,
Delete: resourceCloudAccountVMCDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"accept_self_signed_cert": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_cloud_account_vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func resourceCloudAccountVsphere() *schema.Resource {
Read: resourceCloudAccountVsphereRead,
Update: resourceCloudAccountVsphereUpdate,
Delete: resourceCloudAccountVsphereDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"accept_self_signed_cert": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func resourceDeployment() *schema.Resource {
Read: resourceDeploymentRead,
Update: resourceDeploymentUpdate,
Delete: resourceDeploymentDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"blueprint_id": {
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_flavor_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ func resourceFlavorProfile() *schema.Resource {
Read: resourceFlavorProfileRead,
Update: resourceFlavorProfileUpdate,
Delete: resourceFlavorProfileDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"description": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_image_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ func resourceImageProfile() *schema.Resource {
Read: resourceImageProfileRead,
Update: resourceImageProfileUpdate,
Delete: resourceImageProfileDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"description": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ func resourceLoadBalancer() *schema.Resource {
Read: resourceLoadBalancerRead,
Update: resourceLoadBalancerUpdate,
Delete: resourceLoadBalancerDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func resourceMachine() *schema.Resource {
Read: resourceMachineRead,
Update: resourceMachineUpdate,
Delete: resourceMachineDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"address": &schema.Schema{
Expand Down
4 changes: 4 additions & 0 deletions vra/resource_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func resourceNetwork() *schema.Resource {
Read: resourceNetworkRead,
Update: resourceNetworkUpdate,
Delete: resourceNetworkDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_network_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceNetworkProfile() *schema.Resource {
Read: resourceNetworkProfileRead,
Update: resourceNetworkProfileUpdate,
Delete: resourceNetworkProfileDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ func resourceProject() *schema.Resource {
Read: resourceProjectRead,
Update: resourceProjectUpdate,
Delete: resourceProjectDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"administrators": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_storage_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceStorageProfile() *schema.Resource {
Read: resourceStorageProfileRead,
Update: resourceStorageProfileUpdate,
Delete: resourceStorageProfileDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_storage_profile_aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceStorageProfileAws() *schema.Resource {
Read: resourceStorageProfileAwsRead,
Update: resourceStorageProfileAwsUpdate,
Delete: resourceStorageProfileAwsDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_storage_profile_azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func resourceStorageProfileAzure() *schema.Resource {
Read: resourceStorageProfileAzureRead,
Update: resourceStorageProfileAzureUpdate,
Delete: resourceStorageProfileAzureDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Expand Down
3 changes: 3 additions & 0 deletions vra/resource_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ func resourceZone() *schema.Resource {
Read: resourceZoneRead,
Update: resourceZoneUpdate,
Delete: resourceZoneDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"description": &schema.Schema{
Expand Down

0 comments on commit a5769a0

Please sign in to comment.