Skip to content

Commit f6b5bf4

Browse files
Add name in subnet (#159)
* added name in cldSubnet * docs updated
1 parent f022ab2 commit f6b5bf4

File tree

9 files changed

+38
-3
lines changed

9 files changed

+38
-3
lines changed

aci/data_source_aci_cloudsubnet.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ func dataSourceAciCloudSubnet() *schema.Resource {
2525
Required: true,
2626
},
2727

28+
"name": &schema.Schema{
29+
Type: schema.TypeString,
30+
Optional: true,
31+
Computed: true,
32+
},
33+
2834
"name_alias": &schema.Schema{
2935
Type: schema.TypeString,
3036
Optional: true,

aci/resource_aci_cloudsubnet.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ func resourceAciCloudSubnet() *schema.Resource {
3636
ForceNew: true,
3737
},
3838

39+
"name": &schema.Schema{
40+
Type: schema.TypeString,
41+
Optional: true,
42+
Computed: true,
43+
},
44+
3945
"name_alias": &schema.Schema{
4046
Type: schema.TypeString,
4147
Optional: true,
@@ -104,6 +110,7 @@ func setCloudSubnetAttributes(cloudSubnet *models.CloudSubnet, d *schema.Resourc
104110
cloudSubnetMap, _ := cloudSubnet.ToMap()
105111

106112
d.Set("ip", cloudSubnetMap["ip"])
113+
d.Set("name", cloudSubnetMap["name"])
107114

108115
d.Set("annotation", cloudSubnetMap["annotation"])
109116
d.Set("ip", cloudSubnetMap["ip"])
@@ -146,6 +153,9 @@ func resourceAciCloudSubnetCreate(d *schema.ResourceData, m interface{}) error {
146153
CloudCIDRPoolDn := d.Get("cloud_cidr_pool_dn").(string)
147154

148155
cloudSubnetAttr := models.CloudSubnetAttributes{}
156+
if name, ok := d.GetOk("name"); ok {
157+
cloudSubnetAttr.Name = name.(string)
158+
}
149159
if Annotation, ok := d.GetOk("annotation"); ok {
150160
cloudSubnetAttr.Annotation = Annotation.(string)
151161
} else {
@@ -231,6 +241,9 @@ func resourceAciCloudSubnetUpdate(d *schema.ResourceData, m interface{}) error {
231241
CloudCIDRPoolDn := d.Get("cloud_cidr_pool_dn").(string)
232242

233243
cloudSubnetAttr := models.CloudSubnetAttributes{}
244+
if name, ok := d.GetOk("name"); ok {
245+
cloudSubnetAttr.Name = name.(string)
246+
}
234247
if Annotation, ok := d.GetOk("annotation"); ok {
235248
cloudSubnetAttr.Annotation = Annotation.(string)
236249
} else {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aci
33
go 1.12
44

55
require (
6-
github.com/ciscoecosystem/aci-go-client v1.3.17
6+
github.com/ciscoecosystem/aci-go-client v1.3.20
77
github.com/ghodss/yaml v1.0.0
88
github.com/hashicorp/terraform-plugin-sdk v1.14.0
99
github.com/hashicorp/terraform-plugin-test v1.4.3 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ github.com/ciscoecosystem/aci-go-client v1.3.16 h1:X11gUphT+CPC8/rQzNMyk82yXBiBw
200200
github.com/ciscoecosystem/aci-go-client v1.3.16/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ=
201201
github.com/ciscoecosystem/aci-go-client v1.3.17 h1:mCkNG8paRIA8kVAIpMw8FYpke+ChgbCPdg7BSq6js9k=
202202
github.com/ciscoecosystem/aci-go-client v1.3.17/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ=
203+
github.com/ciscoecosystem/aci-go-client v1.3.20 h1:AFd4MxZY//1wJlbAeDGf00GnHyUHuzySW65PieTCEpo=
204+
github.com/ciscoecosystem/aci-go-client v1.3.20/go.mod h1:fhY7vWysK655g3Yp5Fz4Zje/JN4+moRe8RjwiRy0amQ=
203205
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
204206
github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
205207
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=

vendor/github.com/ciscoecosystem/aci-go-client/client/client.go

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ciscoecosystem/aci-go-client/models/cloud_subnet.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ github.com/aws/aws-sdk-go/service/sts/stsiface
5656
github.com/bgentry/go-netrc/netrc
5757
# github.com/bgentry/speakeasy v0.1.0
5858
github.com/bgentry/speakeasy
59-
# github.com/ciscoecosystem/aci-go-client v1.3.17
59+
# github.com/ciscoecosystem/aci-go-client v1.3.20
6060
github.com/ciscoecosystem/aci-go-client/client
6161
github.com/ciscoecosystem/aci-go-client/container
6262
github.com/ciscoecosystem/aci-go-client/models

website/docs/d/cloud_subnet.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ data "aci_cloud_subnet" "dev_subnet" {
3030
## Attribute Reference
3131

3232
* `id` - Attribute id set to the Dn of the Cloud Subnet.
33+
* `name` - (Optional) Name for object cloud subnet.
3334
* `annotation` - (Optional) annotation for object cloud_subnet.
3435
* `name_alias` - (Optional) name_alias for object cloud_subnet.
3536
* `scope` - (Optional) The domain applicable to the capability.

website/docs/r/cloud_subnet.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Manages ACI Cloud Subnet
1616
resource "aci_cloud_subnet" "foocloud_subnet" {
1717
cloud_cidr_pool_dn = "${aci_cloud_cidr_pool.example.id}"
1818
description = "sample cloud subnet"
19+
name = "subnet1"
1920
ip = "14.12.0.0/28"
2021
annotation = "tag_subnet"
2122
name_alias = "alias_subnet"
@@ -29,6 +30,7 @@ Manages ACI Cloud Subnet
2930
## Argument Reference ##
3031
* `cloud_cidr_pool_dn` - (Required) Distinguished name of parent CloudCIDRPool object.
3132
* `ip` - (Required) CIDR block of Object cloud_subnet.
33+
* `name` - (Optional) Name for object cloud subnet.
3234
* `annotation` - (Optional) annotation for object cloud_subnet.
3335
* `name_alias` - (Optional) name_alias for object cloud_subnet.
3436
* `scope` - (Optional) The domain applicable to the capability. Allowed values are "public", "private" and "shared". Default is "private".

0 commit comments

Comments
 (0)